# -*- coding:utf-8 -*-

class Rotate:
    def rotateMatrix(self, mat, n):
        # write code here
        return zip(*mat[::-1])

# -*- coding:utf-8 -*-

class Rotate:
    def rotateMatrix(self, mat, n):
        # write code here
        for i in range(n):
            for j in range(i, n):
                mat[i][j], mat[j][i] = mat[j][i], mat[i][j]
        for i in range(n):
            mat[i] = mat[i][::-1]
        return mat